package com.niiwoo.civet.user.util;

import com.niiwoo.tripod.base.helper.StringHelper;
import org.apache.commons.lang3.time.FastDateFormat;


import java.util.Date;

public class HashidsUtil {
	
	private static final String DEFALUT_SLAT = "";
	
	private static final String OPTIONAL_CHARACTERS = "23456789abcdefghjkmnpqrstwxyzABCDEFGHJKMNPQRSTWXYZ";
	
	public static String getHashidsString(Long number) {
		return getHashidsString(number, 6);
	}

	public static String getHashidsString(Long number, Integer length) {
		return getHashidsString(number, DEFALUT_SLAT, length);
	}

	public static String getHashidsString(Long number, String slat, Integer length) {
//		Hashids hashids = new Hashids(slat, length, OPTIONAL_CHARACTERS);
//		return hashids.encode(number);
		return "";
	}
	
	public static void main(String[] args) {
		String format = FastDateFormat.getInstance("yyMMdd").format(new Date());
		
    	String inviteCodeNumber = "29999999";
    	String salt = StringHelper.genRandomStr(6);
		System.out.println(HashidsUtil.getHashidsString(Long.valueOf(inviteCodeNumber), 6));
	}
}